function loadImage(service, idRestaurante, idImage, idImg){
	var dataImagen;
	
	if (localStorage.getItem(idRestaurante+ '-' + idImage)) {
		dataImagen = localStorage.getItem(idRestaurante+ '-' + idImage);
		document.getElementById(idImg + idRestaurante+ '-' + idImage).src = dataImagen;
	}else{
		// create a new image object to hold the remote image
		var img = new Image();
		img.src = IPSERVIDOR + SERVICES+'/'+service+'/'+idRestaurante+'/'+idImage;

		// force load image
		$(img).load(function(){

			// create a canvas object
			var canvas = document.createElement("canvas");
			canvas.width = img.width;
			canvas.height = img.height;

			// copy image contents to canvas
			var ctx = canvas.getContext("2d");
			ctx.drawImage(img, 0, 0);

			// get data from canvas object
			var data = canvas.toDataURL("image/png");
			//console.log(data);
			
			localStorage.setItem(idRestaurante+ '-' + idImage,data);
			document.getElementById(idImg + idRestaurante+ '-' + idImage).src = data;
		
		})
	}
	
	return dataImagen;
}
